<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>回调地狱</title>
</head>
<body>
    
</body>
<script>
    // 回调地狱  代码难以维护、嵌套太多，可读性差、耦合度高
    function ajax(url,sucesscb,errorcb){
        setTimeout(()=>{
            sucesscb('1111')
        },1000)
    }


    // 回调地狱
    ajax('./aaa',(data)=>{
        console.log(data);
        ajax('./bbb',(data)=>{
            console.log(data);
            ajax('./ccc',(data)=>{
            })
        },()=>{

        })
    },()=>{
        
    })
</script>
</html>